package com.softeem.servlet;

import com.softeem.action.BaseServlet;
import com.softeem.dao.CourseDao;
import com.softeem.entity.Course;
import com.softeem.service.CourseService;
import com.softeem.service.impl.CourseServiceImpl;

import javax.servlet.annotation.WebServlet;
import java.io.IOException;
import java.sql.SQLException;
import java.util.List;

@WebServlet("/CourseServlet/*")
public class CourseServlet extends BaseServlet {

    private CourseService service = new CourseServiceImpl();

    public List<Course> findCourse() throws SQLException, IOException {
        Course course = new Course();
        List<Course> list1 = service.findCourse();

        System.out.println(list1);
        req.getSession().setAttribute("list1",list1);
        resp.sendRedirect("/index3.jsp");
        return service.findCourse();
    }
}
